<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="android mio4kon mio">
    <meta name="keyword"  content="">
    <link rel="shortcut icon" href="/img/favicon.ico">

    <title>
        
          Mio4kon的博客 | Mio4kon&#39;s Blog
        
    </title>

    <link rel="canonical" href="http://mio4kon.com/">

    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/css/hux-blog.min.css">

    <!-- Pygments Highlight CSS -->
    <link rel="stylesheet" href="/css/highlight.css">

    <!-- Custom Fonts -->
    <!-- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
    <!-- Hux change font-awesome CDN to qiniu -->
    <link href="https://cdn.staticfile.org/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">


    <!-- Hux Delete, sad but pending in China
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/
    css'>
    -->


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- ga & ba script hoook -->
    <script></script>
</head>


<!-- hack iOS CSS :active style -->
<body ontouchstart="">

    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">Mio4kon</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <!-- Known Issue, found by Hux:
            <nav>'s height woule be hold on by its content.
            so, when navbar scale out, the <nav> will cover tags.
            also mask any touch event of tags, unfortunately.
        -->
        <div id="huxblog_navbar">
            <div class="navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/">Home</a>
                    </li>

                    

                        
                    

                        
                        <li>
                            <a href="/about/">About</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/archives/">Archives</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/tags/">Tags</a>
                        </li>
                        
                    
                    
                </ul>
            </div>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
<script>
    // Drop Bootstarp low-performance Navbar
    // Use customize navbar with high-quality material design animation
    // in high-perf jank-free CSS3 implementation
    var $body   = document.body;
    var $toggle = document.querySelector('.navbar-toggle');
    var $navbar = document.querySelector('#huxblog_navbar');
    var $collapse = document.querySelector('.navbar-collapse');

    $toggle.addEventListener('click', handleMagic)
    function handleMagic(e){
        if ($navbar.className.indexOf('in') > 0) {
        // CLOSE
            $navbar.className = " ";
            // wait until animation end.
            setTimeout(function(){
                // prevent frequently toggle
                if($navbar.className.indexOf('in') < 0) {
                    $collapse.style.height = "0px"
                }
            },400)
        }else{
        // OPEN
            $collapse.style.height = "auto"
            $navbar.className += " in";
        }
    }
</script>


    <!-- Main Content -->
    <!-- Page Header -->
<header class="intro-header" style="background-image: url('/img/home-bg.jpg')">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 ">
                <div class="site-heading">
                    <h1>Mio4kon</h1>
                    <!--<hr class="small">-->
                    <span class="subheading">扶我起来 我还能送!</span>
                </div>
            </div>
        </div>
    </div>
</header>



<!-- Main Content -->
<div class="container">
    <div class="row">
        

<!-- USE SIDEBAR -->
    <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-1
                col-md-8 col-md-offset-1
                col-sm-12
                col-xs-12
                post-container
            ">
            
                <!-- Main Content -->


<div class="post-preview">

    <a href="/2019/04/12/OkHttp Http:1.x 与 Http:2.0 相关源码分析/">
        <h2 class="post-title">
            OkHttp Http/1.x 与 Http/2.0 相关源码分析
        </h2>
        <h3 class="post-subtitle">
            源码解析
        </h3>
        <div class="post-content-preview">
            
写这篇博客的目的主要是想了解 Okhttp 在 Http/2.0上是如何实现首部压缩和多路复用的,先从 Ok 主要核心的几个Interceptor 来开头(用到了责任链的设计模式,具体就不展开了), 下面先简单说下这几个Interceptor主要做了什么.

RetryAndFollowUpInterceptor主要职责： 

判断是否可以进行重试
处理返回的响应码非200情况（例如 30......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2019-04-12
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2018/08/24/自定义Android系统/">
        <h2 class="post-title">
            自定义你想要的 Android 系统
        </h2>
        <h3 class="post-subtitle">
            Android
        </h3>
        <div class="post-content-preview">
            这篇博客记录了如何通过修改 Android 的系统源码来定制自己的 Android 系统.内容主要包括下面几点:

系统环境的预准备
下载 Android 源码
编译 Android 源码
刷写设备
定制 Android 系统

下载 Android 源码并编译网上已经有很多教程了,我这里使用的是 mac 系统编译,如果你也查找过相关博客可以知道 mac 系统编译 Android 源码会遇到......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2018-08-24
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2018/03/23/DumpHprof 文件分析记录/">
        <h2 class="post-title">
            DumpHprof 文件分析记录
        </h2>
        <h3 class="post-subtitle">
            源码解析
        </h3>
        <div class="post-content-preview">
            dump 流程
header
fix header

java profile 版本
size of id: 写死的为4
当前时间

当前 hprof remaining length (87133083)
string table
StartNewRecord(TAG,time) 主要作用如下: 

该方法会写入三个值:

写入 tag
写入时间
写入 length

写入之后会写入 id......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2018-03-23
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/12/26/30分钟了解轻量级插件化方案--Small/">
        <h2 class="post-title">
            30分钟了解轻量级插件化方案--Small
        </h2>
        <h3 class="post-subtitle">
            插件化
        </h3>
        <div class="post-content-preview">
            介绍现有的插件化方案有很多,Small以轻量级著称,先看下官方的对比图:

更多对比:https://github.com/wequick/Small/blob/master/Android/COMPARISION.md
插件化? 模块化?

入门Demo
新建一个宿主工程.
project-build中加入依赖:

123456789dependencies &#123;        c......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-12-26
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/12/18/Activity启动流程分析以及如何动态改变启动的页面/">
        <h2 class="post-title">
            Activity启动流程分析以及如何动态改变启动的页面
        </h2>
        <h3 class="post-subtitle">
            Activity启动流程
        </h3>
        <div class="post-content-preview">
            分析首先从Activity的startActivity()为入口点:
Activity.startActivity[Activity.java]
12345678910111213141516171819@Override   public void startActivity(Intent intent, @Nullable Bundle options) &#123;       if ......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-12-18
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/06/23/Appium源码解析之二——第一个请求/">
        <h2 class="post-title">
            Appium源码解析之二——第一个请求
        </h2>
        <h3 class="post-subtitle">
            源码解析
        </h3>
        <div class="post-content-preview">
            前言通过前一篇的源码分析,我们知道Appium如何开启了服务以及如何处理客户端发起的请求.
本篇教程将根据第一个请求,来看一看Appium初始化到底做了哪些事情.
创建SessionId先看看Server的log:

在创建服务之后,收到的第一个请求就是/wd/hub/session,让我们来分析下收到请求后具体都干了哪些事情.
上回说到.收到请求后都会在 buildHandler中做请求处......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-06-23
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/06/18/Appium源码解析——建立连接/">
        <h2 class="post-title">
            Appium源码解析之一——建立连接
        </h2>
        <h3 class="post-subtitle">
            源码解析
        </h3>
        <div class="post-content-preview">
            本地运行Appium源码
首先先下载 Appium 源码: https://github.com/appium/appium
进入工程目录
执行 npm install
执行 node build/lib/main.js 

建立Appium连接根据启动命令可以知道程序入口点在lib/main.js中.
[appium:lib/main.js]
1234567async function m......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-06-18
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/06/12/Appium踩坑之旅——小米手机/">
        <h2 class="post-title">
            Appium踩坑之旅——小米手机
        </h2>
        <h3 class="post-subtitle">
            踩坑之旅
        </h3>
        <div class="post-content-preview">
            前言了解过 Appium 或看过我之前写的系列教程的人,一定知道在与Appium Server连接的时候会传入相应的capabilities.

platformName
automationName
autoLaunch
noSign
….

automationName是告诉 Appium Server是用什么方式来操作UI元素的.对应源码来说就是使用什么样的 Driver.(下一篇教程......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-06-12
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/04/13/移动端自动化测试系列之五——AppiumLich框架使用/">
        <h2 class="post-title">
            移动端自动化测试系列之五——AppiumLich框架使用
        </h2>
        <h3 class="post-subtitle">
            AppiumLich框架使用
        </h3>
        <div class="post-content-preview">
            前言经历了前面一系列的教程,相信你一定跃跃一试了,本篇教程将告诉你如何使用框架(appium-Lich)来进行移动端的自动化测试.
Let’s go
项目结构先看下项目的目录结构


apk 文件夹下放置想测试的 *.apk 文件
data/config.ini文件中需要修改[name]与[account]中的内容
data/page.yaml文件就是系列四中提到的定位元素的文件
test/......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-04-13
    </p>

</div>
<hr>

<div class="post-preview">

    <a href="/2017/04/13/移动端自动化测试系列之四——生成定位元素/">
        <h2 class="post-title">
            移动端自动化测试系列之四——生成定位元素
        </h2>
        <h3 class="post-subtitle">
            优雅的生成定位元素
        </h3>
        <div class="post-content-preview">
            前言之所以把定位元素单独拎出来说,是因为我觉得在写移动端测试框架的时候,如果处理不好的话,元素的定位是比较麻烦的事情.
如果对 Appium 稍微了解的童鞋一定知道定位元素的方式有很多种:

id
name
xpath
tag_name
…

这么多的查找方式如果都写在代码中如下:
12345find_elements_by_id(R.id.login)find_elements_by_na......
        </div>
    </a>
    <p class="post-meta">
        Posted by Mio4kon on
        2017-04-13
    </p>

</div>
<hr>



<!-- Pager -->

<ul class="pager">
    
    
        <li class="next">
            <a href="/page/2/">Older Posts &rarr;</a>
        </li>
    
</ul>



                <!-- 如果开启评论功能 -->
                

            </div>
    <!-- Sidebar Container -->
            <div class="
                col-lg-3 col-lg-offset-0
                col-md-3 col-md-offset-0
                col-sm-12
                col-xs-12
                sidebar-container
            ">
                <!-- Featured Tags -->
                
                <section>
                    <!-- no hr -->
                    <h5><a href="/tags/">FEATURED TAGS</a></h5>
                    <div class="tags">
                        
                            
                        
                            
                        
                            
                        
                            
                        
                            
                            <a href="/tags/#移动自动化测试" title="移动自动化测试" rel="8">移动自动化测试</a>
                            
                        
                            
                        
                            
                        
                            
                        
                            
                        
                            
                            <a href="/tags/#Kotlin" title="Kotlin" rel="2">Kotlin</a>
                            
                        
                            
                        
                            
                        
                            
                            <a href="/tags/#Material Design" title="Material Design" rel="3">Material Design</a>
                            
                        
                            
                        
                            
                        
                            
                        
                            
                        
                            
                        
                            
                        
                            
                        
                            
                            <a href="/tags/#Head First,设计模式" title="Head First,设计模式" rel="2">Head First,设计模式</a>
                            
                        
                            
                        
                            
                        
                            
                        
                            
                            <a href="/tags/#源码分析" title="源码分析" rel="2">源码分析</a>
                            
                        
                    </div>
                </section>
                

                <!-- Short About -->
                <section class="visible-md visible-lg">
                    <hr><h5><a href="/about/">ABOUT ME</a></h5>
                    <div class="short-about">

                        
                            <img src="/img/Mio-Akiyama.jpg" />
                        

                        
                            <p>扶我起来,我还能送!</p>
                        

                        <!-- SNS Link -->
                        <ul class="list-inline">
                            
                            
                            

                            
                                <li>
                                    <a target="_blank" href="http://weibo.com/u/3198010790">
                                        <span class="fa-stack fa-lg">
                                            <i class="fa fa-circle fa-stack-2x"></i>
                                            <i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
                                        </span>
                                    </a>
                                </li>
                            

                            

                            
                                <li>
                                    <a target="_blank"  href="https://github.com/Mio4kon">
                                        <span class="fa-stack fa-lg">
                                            <i class="fa fa-circle fa-stack-2x"></i>
                                            <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                                        </span>
                                    </a>
                                </li>
                            
                            
                            
                            
                        </ul>
                    </div>
                </section>
                
                <!-- Friends Blog -->
                
                <hr>
                <h5>FRIENDS</h5>
                <ul class="list-inline">

                    
                        <li><a href="http://lrd.ele.me/" target="_blank">lrd ele&#39;s Blog</a></li>
                    
                </ul>
                
            </div>
        
    </div>
</div>


    <!-- Footer -->
    <!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">
                
                
                

                
                    <li>
                        <a target="_blank" href="http://weibo.com/u/3198010790">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                

                
                    <li>
                        <a target="_blank"  href="https://github.com/Mio4kon">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                

                </ul>
                <p class="copyright text-muted">
                    Copyright &copy; Mio4kon 2019 
                    <br>
                    Theme by <a href="http://huangxuan.me">Hux</a> 
                    <span style="display: inline-block; margin: 0 5px;">
                        <i class="fa fa-heart"></i>
                    </span> 
                    Ported by <a href="http://blog.kaijun.rocks">Kaijun</a> | 
                    <iframe
                        style="margin-left: 2px; margin-bottom:-5px;"
                        frameborder="0" scrolling="0" width="91px" height="20px"
                        src="https://ghbtns.com/github-btn.html?user=kaijun&repo=hexo-theme-huxblog&type=star&count=true" >
                    </iframe>
                </p>
            </div>
        </div>
    </div>
</footer>

<!-- jQuery -->
<script src="/js/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="/js/bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="/js/hux-blog.min.js"></script>


<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>

<!-- 
     Because of the native support for backtick-style fenced code blocks 
     right within the Markdown is landed in Github Pages, 
     From V1.6, There is no need for Highlight.js, 
     so Huxblog drops it officially.

     - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0  
     - https://help.github.com/articles/creating-and-highlighting-code-blocks/    
-->
<!--
    <script>
        async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
            hljs.initHighlightingOnLoad();
        })
    </script>
    <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->


<!-- jquery.tagcloud.js -->
<script>
    // only load tagcloud.js in tag.html
    if($('#tag_cloud').length !== 0){
        async("http://mio4kon.com/js/jquery.tagcloud.js",function(){
            $.fn.tagcloud.defaults = {
                //size: {start: 1, end: 1, unit: 'em'},
                color: {start: '#bbbbee', end: '#0085a1'},
            };
            $('#tag_cloud a').tagcloud();
        })
    }
</script>

<!--fastClick.js -->
<script>
    async("https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js", function(){
        var $nav = document.querySelector("nav");
        if($nav) FastClick.attach($nav);
    })
</script>


<!-- Google Analytics -->




<!-- Baidu Tongji -->


<!-- Side Catalog -->





<!-- Image to hack wechat -->
<img src="http://mio4kon.com/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->

</body>

</html>
